import 'package:flutter/material.dart';
import 'package:food_web/constant.dart';

class DefaultButton extends StatelessWidget {
  final String text;
  final Function press;
  const DefaultButton({
    Key? key,
    required this.text,
    required this.press,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ClipRRect(
      borderRadius: BorderRadius.circular(25),
      child: TextButton(
        onPressed: () {
          print('妈的');
        },
        style: ButtonStyle(
          foregroundColor: MaterialStateProperty.resolveWith(
            (states) {
              return KTextColor;
            },
          ),
          backgroundColor: MaterialStateProperty.all(KPrimaryColor),
          padding: MaterialStateProperty.all(
            EdgeInsets.symmetric(
              horizontal: 25,
              vertical: 20,
            ),
          ),
        ),
        child: Text(text.toUpperCase()),
      ),
    );
  }
}
